package com.zcmob.web.admanagement.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class for Servlet: Logout
 *
 */
 public class Logout extends com.zcmob.web.admanagement.servlet.ZcMobServlet {
   static final long serialVersionUID = 1L;
   
    /* (non-Java-doc)
	 * @see javax.servlet.http.HttpServlet#HttpServlet()
	 */
	public Logout() {
		super();
	}

    @Override
    protected void handle(HttpServletRequest request, HttpServletResponse response) {
        
        request.getSession().removeAttribute("aduser");
        
        RequestDispatcher rd = request.getRequestDispatcher("ad_login.jsp");
        try {
            rd.forward(request, response);
        } catch (ServletException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
    }   	 	  	  	    
}